<?php
require_once (APPPATH.'views/components/page.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!-- Import this script manually to prevent page reloaded		 -->
		<script type='text/javascript' src='<?php echo base_url() ?>resources/js/ddaccordion.js'></script>
        
 		<?php
			$page = new Page();
			$error = ERROR_NONE;
			$error = $this->session->userdata('error');
			$this->session->unset_userdata('error');
			
			if (isset($rerror))
				$error = $rerror;
			
			if ($error > ERROR_NONE)
				$title = "Lỗi";
			else
				$title = $category->getTitle();
			$page->generateHeader($title);
		?> 
	</head>
	
	<body>
        <?php
			$page->openMainPageTag();
			
			$page->generateLeftPan();
			$page->generateRightPanProductDetail(isset($category) ? $category : NULL, isset($producttype) ? $producttype : NULL, isset($product) ? $product : NULL, isset($related_products) ? $related_products : NULL, $error);
			$page->generateFooter();
			
			$page->closeMainPageTag();
		?>
	</body>
</html>